#region File Header

//----------------------------------------------------------------
// Copyright (C) 2002 Stefan Kyntchev
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR 
// FITNESS FOR A PARTICULAR PURPOSE.
//----------------------------------------------------------------

#endregion File Header

using System;
using AirWeb.ApplicationTools;

namespace FlashBack.Web
{
	/// <summary>
	///    Summary description for ManageAccess.
	/// </summary>
	public partial class ManageAccess : PageBase
	{
		/// <summary>
		/// Constructor
		/// </summary>
		public ManageAccess()
		{
			Page.Init += new EventHandler(Page_Init);
		}

		protected void Page_Load(object sender, EventArgs e)
		{
			Response.Expires = -1;
			ValidateCurrentUserIsAdministrator();

			string role;

			if (!IsPostBack)
			{
				role = Session["Role to Edit"].ToString();
				ViewState["Role to Edit"] = role;
			}
			else
			{
				role = ViewState["Role to Edit"].ToString();
			}

			title.Text = "Manage Access for " + role;

			ManageAccessTreeModel m = new ManageAccessTreeModel();
			DirectoryHelper d = new DirectoryHelper();

			m.SetPath(Server.MapPath(d.CreateOriginalPath("\\")));
			m.SetContext(Context);
			m.SetRole(role);

			MyTree.TreeModel = m;
			MyTree.AutoExpandLevel = 100;
		}

		protected void Page_Init(object sender, EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP+ Windows Form Designer.
			//
			InitializeComponent();
		}

		/// <summary>
		///    Required method for Designer support - do not modify
		///    the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
		}
	}
}